package com.sxbbc.common.core.mapper.jz;

import com.sxbbc.common.core.dto.jz.DataVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sxbbc.common.core.entity.jz.AgAccount;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 代理资金账户表 Mapper 接口
 * </p>
 *
 * @author leehao
 * @since 2019-07-10
 */
public interface AgAccountMapper extends BaseMapper<AgAccount> {

    /**
     * 统计用户账户有效的贡献值
     * @param changeUnit 满足该条件
     * @author leehao
     * @return java.math.BigDecimal
     */
    BigDecimal sumTotalWithValid(@Param("changeUnit") BigDecimal changeUnit);

    /**
     * 查询有效的贡献值信息 cid和donate
     * @author leehao
     * @return java.util.List<com.sxbbc.common.core.dto.jz.DataVo>
     */
    List<DataVo> queryValidDonateList(@Param("validDonate") BigDecimal validDonate);

    AgAccount getById(Integer agid);

    int updateLockVersion(AgAccount account);
}
